package com.hehe.ai.langchain4j.tools;

import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Component;

/**
 * @author: hehe
 * @create: 2025-05-14 15:27
 * @Description:
 */
@Component
public class CalculatorTools {
    @Tool(name="加法运算",value = "将两个参数a和b相加并返回运算结果")
    double sum(double a, double b) {
        System.out.println("调用加法运算");
        return a + b;
    }

    @Tool(name="平仿根运算",value = "计算给定参数的平方根并返回运算结果")
    double squareRoot(double x) {
        System.out.println("调用平方根运算");
        return Math.sqrt(x);
    }

}
